Skip to content

docs(claude-code): document pre_install_script for module dependency ordering#613

Merged
DevelopmentCats merged 6 commits intocoder:mainfrom
altana-ai:jwb/claude-code-pre-start-script
Mar 3, 2026
Merged

docs(claude-code): document pre_install_script for module dependency ordering#613
DevelopmentCats merged 6 commits intocoder:mainfrom
altana-ai:jwb/claude-code-pre-start-script

Conversation

@jasonwbarnett
Copy link
Contributor

Summary

Clarifies that the existing pre_install_script variable can be used to handle dependencies between modules during workspace startup.

Problem

When using multiple startup modules (e.g., git-clone and claude-code), there's a race condition where scripts execute in parallel. Module dependencies need to be managed, such as ensuring git-clone completes before Claude Code tries to access a workdir.

Solution

The existing pre_install_script variable already provides this capability. Updated documentation to clarify this use case.

Example

module "claude-code" {
  source = "registry.coder.com/coder/claude-code/coder"
  
  workdir = "/path/to/repo"
  
  # Wait for git-clone to complete before starting
  pre_install_script = <<-EOT
    #!/bin/bash
    set -e
    while [ ! -f /tmp/.git-clone-complete ]; do
      sleep 1
    done
  EOT
}

Resolves issue #609.

…ordering

Update the pre_install_script variable description to clarify that it can be
used for handling dependencies between modules, such as waiting for git-clone
to complete before Claude Code initialization.
Copy link
Contributor

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we will need to update the version here for the change to reflect

@DevelopmentCats DevelopmentCats added the version:patch Add to PRs requiring a patch version upgrade label Jan 7, 2026
@DevelopmentCats
Copy link
Contributor

@jasonwbarnett I just wanted to check in on this.

@DevelopmentCats
Copy link
Contributor

@jasonwbarnett I just wanted to double-check in on this.

@DevelopmentCats DevelopmentCats removed the version:patch Add to PRs requiring a patch version upgrade label Mar 3, 2026
@DevelopmentCats DevelopmentCats merged commit ac49e6e into coder:main Mar 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants